package com.sk.logistics.listener;

import com.sk.order.model.OrderInfo;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class OrderListener {
    @RabbitListener(queues = "order.create")
    public void handleMessage(String orderInfo){
        System.out.println("接收到订单消息String:"+ orderInfo);
        //接收到订单消息之后, 进行相应的业务处理
        //业务代码省略
    }

    @RabbitHandler
    public void handleMessage(OrderInfo orderInfo){
        System.out.println("接收到订单消息OrderInfo:"+ orderInfo);
        //接收到订单消息之后, 进行相应的业务处理
        //业务代码省略
    }
}